/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jsoft.netbeans.dbdesigner.filetype;

import org.jsoft.netbeans.dbdesigner.editor.ERDTopComponent;
import org.openide.cookies.CloseCookie;
import org.openide.cookies.OpenCookie;
import org.openide.loaders.OpenSupport;
import org.openide.windows.CloneableTopComponent;

/**
 *
 * @author jsoft
 */
public class ERDOpenSupport extends OpenSupport implements OpenCookie, CloseCookie{

    public ERDOpenSupport(ERDDataObject.Entry entry) {
        super(entry);
    }

    @Override
    protected CloneableTopComponent createCloneableTopComponent() {
        ERDDataObject erd = (ERDDataObject) entry.getDataObject();
        ERDTopComponent tc = new ERDTopComponent(erd);
        erd.addSaveAction(tc);
        tc.setDisplayName(erd.getName());

        return tc;
        
    }



}
